package com.xdcplus.web.service.wip;

import com.xdcplus.mp.service.BaseService;
import com.xdcplus.pager.vo.PageVO;
import com.xdcplus.web.common.pojo.dto.wip.WipUnpackBindMaterialDTO;
import com.xdcplus.web.common.pojo.dto.wip.WipUnpackPlanDTO;
import com.xdcplus.web.common.pojo.dto.wip.WipUnpackPlanFilterDTO;
import com.xdcplus.web.common.pojo.dto.wip.WipUpPackUpdateCountDTO;
import com.xdcplus.web.common.pojo.entity.wip.WipUnpackPlan;
import com.xdcplus.web.common.pojo.vo.splitunpack.GetUnpackPlanByToolCodeVo;
import com.xdcplus.web.common.pojo.vo.wip.UnPackMaterialDetailVO;
import com.xdcplus.web.common.pojo.vo.wip.WipUnpackPlanVO;

import java.util.List;


/**
 * 投料/拆包计划表(WipUnpackPlan)表服务接口层
 *
 * @author xyy
 * @since 2023-05-04 19:55:25
 */
public interface WipUnpackPlanService extends BaseService<WipUnpackPlan, WipUnpackPlan, WipUnpackPlanVO> {

    /**
     * 添加投料/拆包计划表(WipUnpackPlan)
     *
     * @param wipUnpackPlanDTO 投料/拆包计划表(WipUnpackPlanDTO)
     * @return {@link Boolean} 是否成功
     */
    WipUnpackPlan saveWipUnpackPlan(WipUnpackPlanDTO wipUnpackPlanDTO);

    /**
     * 修改投料/拆包计划表(WipUnpackPlan)
     *
     * @param wipUnpackPlanDTO 投料/拆包计划表(WipUnpackPlanDTO)
     * @return {@link Boolean} 是否成功
     */
    Boolean updateWipUnpackPlan(WipUnpackPlanDTO wipUnpackPlanDTO);

    /**
     * 批量保存或更新投料/拆包计划表(WipUnpackPlan)
     *
     * @param wipUnpackPlanList 投料/拆包计划表(WipUnpackPlanList)
     * @return {@link Boolean} 是否成功
     */
    Boolean saveOrUpdateBatch(List<WipUnpackPlan> wipUnpackPlanList);

    /**
     * 批量保存或更新投料/拆包计划表(WipUnpackPlanDTOList)
     *
     * @param wipUnpackPlanDTOList 投料/拆包计划表(WipUnpackPlanDTOList)
     * @return {@link Boolean} 是否成功
     */
    Boolean saveOrUpdateBatchByDTOList(List<WipUnpackPlanDTO> wipUnpackPlanDTOList);

    /**
     * 删除投料/拆包计划表(WipUnpackPlan)
     *
     * @param id 投料/拆包计划表(WipUnpackPlan)主键
     * @return {@link Boolean} 是否成功
     */
    Boolean deleteWipUnpackPlanLogical(Long id);

    /**
     * 取消拆包计划
     * @param id
     * @return
     */
    void cancelWipUnpackPlan(Long id,String updatedUser);



    Boolean deleteWipUnpackPlanByIds(String ids);

    /**
     * 查询投料/拆包计划表(WipUnpackPlan)
     *
     * @param wipUnpackPlanFilterDTO 过程状态过滤DTO
     * @return {@link PageVO<WipUnpackPlanVO>} 状态信息
     */
    List<WipUnpackPlanVO> queryWipUnpackPlanVOList(WipUnpackPlanFilterDTO wipUnpackPlanFilterDTO);

    /**
     * 查询投料/拆包计划表(WipUnpackPlan)
     *
     * @param wipUnpackPlanFilterDTO 过程状态过滤DTO
     * @return {@link PageVO<WipUnpackPlanVO>} 状态信息
     */
    PageVO<WipUnpackPlanVO> queryWipUnpackPlan(WipUnpackPlanFilterDTO wipUnpackPlanFilterDTO);

    /**
     * 查询一个
     *
     * @param id 投料/拆包计划表(WipUnpackPlan)主键
     * @return {@link WipUnpackPlanVO} 投料/拆包计划表(WipUnpackPlan)信息
     */
    WipUnpackPlanVO queryWipUnpackPlanById(Long id);

    void commandWipUnpackPlan(List<Long> ids,String username);

    /**
     * 通过拆包信息表id获取来料信息
     * @param id
     * @return
     */
    UnPackMaterialDetailVO findMaterialDetailInfo(Long id);


    void  bindMaterialBox(WipUnpackBindMaterialDTO wipUnpackBindMaterialDTO, String username);
    void  updateMaterialCount(WipUpPackUpdateCountDTO wipUpPackUpdateCountDTO, String username);

    /**
     * 根据过账查询拆包计划
     * @param commissioningDate 投产日期
     * @param pmShiftPlanIdFk  班次
     * @param toolCode  设备编码
     * @return
     */
    WipUnpackPlan getUnpackPlanByProcess(String commissioningDate,Long pmShiftPlanIdFk,String toolCode);

    GetUnpackPlanByToolCodeVo getUnpackPlanByToolCode(String toolCode);

    void canelWipUnpackPlan(List<Long> wipUnpackPlanIds, String account);


    void deleteBatchWipUnpackPlanLogical(List<Long> wipUnpackPlanIds);

    WipUnpackPlan getUnpackPlanByPlanCode(String planCode);

    List<WipUnpackPlan> getUnpackPlanByPlanCodes(List<String> unpackPlanCodes);
}
